package ssm.ann.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ssm.ann.pojo.User;
import ssm.ann.service.UserService;

import java.util.HashMap;
import java.util.Map;

//@Controller
@RestController
@RequiredArgsConstructor
public class UserController {
    final UserService userServiceImpl;

    @RequestMapping("list")
    public Object list(User user) {
        System.out.println(userServiceImpl.listAll());
        return user;
    }

    @GetMapping("hw")
    public Object helloworld(String xx) {
        userServiceImpl.hello();
        Map<String, Object> map = new HashMap<>(1);
        map.put("hw", "hw:" + xx);
        return map;
    }
}
